﻿@model IEnumerable<Common.Product>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Product Catalogue</h2>

<table>
    <tr>
        <th>
            Name
        </th>
        <th>
            Features
        </th>
        <th>
            Image
        </th>
        <th>
            Stock
        </th>
        <th>
            Price
        </th>
        <th>
            DateAdded
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Features)
        </td>
        <td>
            <img src="@Html.DisplayFor(modelItem => item.Image)" alt ="" width= "100px" height = "100px" />
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Stock)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Price)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DateAdded)
        </td>
        <td>
            @Html.ActionLink("Details", "Details", new { id=item.ID })
        </td>
    </tr>
}

</table>
